package org.jeecg.modules.dock.client;

import com.dtflys.forest.annotation.*;
import com.dtflys.forest.converter.json.ForestJacksonConverter;
import com.dtflys.forest.http.ForestRequest;
import com.dtflys.forest.http.ForestResponse;
import org.jeecg.modules.dock.constant.SystemConstants;
import org.jeecg.modules.dock.entity.mds.MdsBaseResponseVO;
import org.jeecg.modules.dock.entity.mds.request.*;

import java.util.List;

/**
 * mds对接接口
 *
 * @author zhoutong
 */
@BaseRequest(
        baseURL = "${mdsAddress}",
        headers = {"~request_method:POST", "content-Type:application/json", SystemConstants.SYS_HEADER + ":" + SystemConstants.MDS}
)
@ForestClient
public interface MdsRequestClient {

    /**
     * 横剪叫料
     *
     * @param vo
     * @return
     */
    @Post(value = "/api/HJTake", decoder = ForestJacksonConverter.class)
    ForestResponse<MdsBaseResponseVO> mdsTransverseShearingIsCalledMaterial(@Body MDSTransverseShearingIsCalledMaterialRequestVO vo);

    /**
     * 横剪退料
     *
     * @param vo
     * @return
     */
    @Post(value = "api/HJReturn", decoder = ForestJacksonConverter.class)
    ForestResponse<MdsBaseResponseVO> mdsCrossShearingToWithdrawMaterial(@Body MDSCrossShearingToWithdrawMaterialRequestVO vo);

    /**
     * 横剪叫料板
     *
     * @param vo
     * @return
     */
    @Post(value = "api/HJTakePlank", decoder = ForestJacksonConverter.class)
    ForestResponse<MdsBaseResponseVO> mdsTransverseShearIsCalledMaterialPlate(@Body MDSTransverseShearIsCalledMaterialPlateRequestVO vo);

    /**
     * 横剪叫废料箱
     *
     * @param vo
     * @return
     */
    @Post(value = "api/HJTakeWaste", decoder = ForestJacksonConverter.class)
    ForestResponse<MdsBaseResponseVO> mdsTheTransverseShearIsCalledAScrapBin(@Body MDSTheTransverseShearIsCalledAScrapBinRequestVO vo);

    /**
     * 横剪退废料箱
     *
     * @param vo
     * @return
     */
    @Post(value = "api/HJReturnWaste", decoder = ForestJacksonConverter.class)
    ForestResponse<MdsBaseResponseVO> mdsCrossCutTheScrapBin(@Body MDSCrossCutTheScrapBinRequestVO vo);

    /**
     * 横剪入库
     *
     * @param vo
     * @return
     */
    @Post(value = "api/HJReturnWaste", decoder = ForestJacksonConverter.class)
    ForestResponse<MdsBaseResponseVO> mdsCrossCutIntoStorage(@Body MDSCrossCutIntoStorageRequestVO vo);

    /**
     * 叠片叫料
     *
     * @param vo
     * @return
     */
    @Post(value = "api/DPTake", decoder = ForestJacksonConverter.class)
    ForestResponse<MdsBaseResponseVO> mdsLaminationIsCalledMaterial(@Body MDSLaminationIsCalledMaterialRequestVO vo);

    /**
     * 叠片退料
     *
     * @param vo
     * @return
     */
    @Post(value = "api/DPReturn", decoder = ForestJacksonConverter.class)
    ForestResponse<MdsBaseResponseVO> mdsLaminationAndRefeeding(@Body MDSLaminationAndRefeedingRequestVO vo);

    /**
     * 叠片退料板
     *
     * @param vo
     * @return
     */
    @Post(value = "api/DPReturnPlack", decoder = ForestJacksonConverter.class)
    ForestResponse<MdsBaseResponseVO> mdsLaminatedRefeedingPlate(@Body MDSLaminatedRefeedingPlateRequestVO vo);

    /**
     * 条料调拨入库
     *
     * @param vo
     * @return
     */
    @Post(value = "api/TLAllotStock", decoder = ForestJacksonConverter.class)
    ForestResponse<MdsBaseResponseVO> materialTransferAndWarehousing(@Body MaterialTransferAndWarehousingRequestVO vo);

    /**
     * 条料库叫料架
     *
     * @param vo
     * @return
     */
    @Post(value = "api/TLAllotPlank", decoder = ForestJacksonConverter.class)
    ForestResponse<MdsBaseResponseVO> malledMaterialRack(@Body MalledMaterialRackRequestVO vo);

    /**
     * 条料调拨出库
     *
     * @param vo
     * @return
     */
    @Post(value = "api/TLAllotOutBound", decoder = ForestJacksonConverter.class)
    ForestResponse<MdsBaseResponseVO> materialTransferAndOutbound(@Body MaterialTransferAndOutboundRequestVO vo);

    /**
     * 强制完成
     *
     * @param vo
     * @return
     */
    @Post(value = "api/ForceComplete", decoder = ForestJacksonConverter.class)
    ForestResponse<MdsBaseResponseVO> forceComplete(@Body ForceCompleteRequestVO vo);

    /**
     * 配送
     *
     * @param vo
     * @return
     */
    @Post(value = "api/HJSend", decoder = ForestJacksonConverter.class)
    ForestResponse<MdsBaseResponseVO> delivery(@Body MDSDeliveryRequestVO vo);

    /**
     * 退空料架
     *
     * @param vo
     * @return
     */
    @Post(value = "api/HJReturnRack", decoder = ForestJacksonConverter.class)
    ForestResponse<MdsBaseResponseVO> emptyMaterialRack(@Body EmptyMaterialRackRequestVO vo);

    /**
     * 即时库存
     *
     * @return
     */
    @Post(value = "api/GetLocation/{id}", decoder = ForestJacksonConverter.class)
    ForestResponse<List<MdsRepertoryVO>> repertory(@Var("id") Integer id);

}
